<?php

/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of robro_modelo
 *
 * @author jose
 */
class Recibo_cancela extends CI_Model {

    //put your code here
    public function guardar($data) {
        $this->db->insert("recibo_cancela", $data);
        return $this->db->insert_id(); 
    }

    //patricio 2 de junio 
    public function elimina($ide_plan,$tabla) {
        switch ($tabla){
            case 1:
                $this->db->where('ide_plan1',$ide_plan );
                $this->db->where('tabla_plan1',1 );
                
                break;
            case 2:
                $this->db->where('ide_plan2',$ide_plan );
                $this->db->where('tabla_plan2',1 );
                
                break;
            case 3:
                $this->db->where('ide_plan3',$ide_plan );
                $this->db->where('tabla_plan3',1 );
                
                break;
            
            
        }
        $this->db->delete("recibo_cancela"); 
    }
   
    
}

?>
